/**
***********************************************************************
*
* Copyright 2011 Stefan Wöhle
*
* This file is part of PixelMath
*
* PixelMath is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PixelMath is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PixelMath. If not, see <http://www.gnu.org/licenses/>.
*
***********************************************************************
*/

#ifndef FORMULAEDITOR_H
#define FORMULAEDITOR_H

#include <QMainWindow>

namespace Ui {
    class FormulaEditor;
}
class PixelMathWindow;
class FormulaWidget;

/*********************************************************
 *
 *  FormulaEditor
 *
 *  This class allows to create a formel via the GUI
 *  and apply it to the image on the PixelMathWindow.
 *
 **********************************************************/

class FormulaEditor : public QMainWindow
{
    Q_OBJECT
public:
protected:
private:
    Ui::FormulaEditor *ui;
    PixelMathWindow   *owner;
    FormulaWidget     *redFW;
    FormulaWidget     *greenFW;
    FormulaWidget     *blueFW;

public:
    explicit FormulaEditor(PixelMathWindow *owner);
    ~FormulaEditor();
protected:
private:
    void cutColorValue(int &c);

public slots:
protected slots:
private slots:
    void on_applyButton_clicked();
    void on_actionClose_triggered();
    void formulaAnchorChoosen(FormulaWidget *formulaWidget);
    void replaceSubwidget(QObject *destroyed);

signals:
};

#endif // FORMULAEDITOR_H
